﻿<div id="pager" class="pager">
    <div class="info_pg">共@(ViewBag.PagerList.TotalItems)条</div>
    <div class="list_pg">
        <a href="@ViewBag.PagerUrl?@ViewBag.queryString&p=1" class="first">首页</a>
        @if (@ViewBag.PagerList.HasPreviousPage && @ViewBag.PagerList.TotalItems > 0) {
            <a href="@ViewBag.PagerUrl?@ViewBag.queryString&p=@ViewBag.PagerList.PreviousPageIndex" class="prev">上一页</a>
        } else {
            <a class="prev none">上一页</a>
        }
        @foreach(var i in @ViewBag.PagerList.PageArray){
            if (@i == @ViewBag.PagerList.CurrentPageIndex) {
                <a class="current">@i</a>
            } else if (@i == 0) {
                <a class="more">…</a>
            } else {
                <a href="@ViewBag.PagerUrl?@ViewBag.queryString&p=@i" href="#">@i</a>
            }
        }
        @if (@ViewBag.PagerList.HasNextPage && @ViewBag.PagerList.TotalItems > 0)
        {
            <a class="next" href="@ViewBag.PagerUrl?@ViewBag.queryString&p=@ViewBag.PagerList.NextPageIndex">下一页</a>
        }else{
            <a class="next none">下一页</a>
        }
        <a class="last" href="@ViewBag.PagerUrl?@ViewBag.queryString&p=@ViewBag.PagerList.TotalPages">尾页</a>
        <!-- <span class="msg">跳转</span>
            <input class="text" type="text" value="">
            <span class="msg">页</span>-->
    </div>
</div>